#ifndef MULTIMATH_H_
#define MULTIMATH_H_

class CVector
{
public:
	CVector(float x, float y, float z);
	CVector(void);
	~CVector(void);

	void Normalize(void);
	CVector operator+(const CVector& rhs);
	CVector operator*(const CVector& rhs); // cross product
	CVector operator-();
	
public:
	float X;
	float Y;
	float Z;
};

class CQuaternion;

class CMatrix
{
public:
	CMatrix(void);
	~CMatrix(void);

	void CreateIdentity(void);
	void CreateRotationX(float angle);
	void CreateRotationY(float angle);
	void CreateRotationZ(float angle);
	CMatrix operator+(const CMatrix& rhs);
	CMatrix operator*(const CMatrix& rhs);
	float operator[](const int index);

	void FromQuaternion(const CQuaternion& source);
	void FromVectors(const CVector& vecX, const CVector& vecY, const CVector& vecZ);
	void GetRollPitchYaw(float& roll, float& pitch, float& yaw);

public:
	float m[9];
};

class CQuaternion
{
public:
	CQuaternion(void);
	~CQuaternion(void);

	void Normalize(void);
	void FromMatrix(CMatrix& mat);
	void FromSlerp(CQuaternion& a, CQuaternion& b, float t);

public:
	float X;
	float Y;
	float Z;
	float W;
};


#endif /*MULTIMATH_H_*/
